Repository navigation
fix(gateway): refuse writes under a lease that is no longer held - #1601
Merged
Merged
Conversation
kvinwang
added a commit
that referenced
this pull request
Nov 18, 2026
CertLock follows #1599-#1601 on wavekv 2.2: the lock value carries a nonce, a lease stamped beyond the drift bound counts as expired, and release and lease-guarded writes are no-ops once the lease expired by the local clock. The force-release, clock-step-back and stale-release counterexamples become positive theorems: ownership on one node under any clock, and a release or guarded commit losing LWW to any successor whose clock is within the drift bound. The replication gap, skew beyond the drift bound, and cross-node force release remain as counterexamples. Sni follows #1602: the returned name lies within every declared block. CertStore follows #1603: no exact-match table, empty first label refused. Signed-off-by: Kevin Wang <wy721@qq.com>
Signed-off-by: Kevin Wang <wy721@qq.com>
kvinwang
force-pushed
the
fix/gateway-lease-before-commit
branch
from
November 18, 2026 08:46
e68a9f8 to
357c8cf
Compare
kvinwang
enabled auto-merge
November 18, 2026 08:46
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work under a renew or ACME-account lease was not bounded by the lease. Past its expiry (or after a force release) a peer may take over, and both holders would commit.
KvStore::{cert,rotation}_lock_still_heldchecks the conditionrelease_lockuses: the stored value is ours and the lease is unexpired by the local clock. It is checked right before each irreversible write under a lease: saving the certificate and its attestation, publishing ACME credentials and their attestation (rotation and first-use registration), and each CAA write. A lost lease aborts with an error instead.renew_timeoutis capped at half the renew lease (300 s, the current default), leaving the other half for the work around the order and clock skew. Enforced inSetCertbotConfig.The check and the write are still two steps; across nodes this stays best-effort (no CAS in WaveKV), but a holder no longer commits after its lease is gone.
Stacked on #1600; only the last commit is new.